<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>

<body>
    <script>
        function sum(num1, num2) {
            this.sum1 = num1 + num2;
        }
        sum(10, 20);
        console.log(window.sum1);

        var obj = {
            name: 'jack'
        }

        sum.apply(obj, [30, 80]);
        console.log(obj);

        var arr = [];

        arr.push.apply(arr, [10, 100, 30, 34]);
        console.log(arr);

    </script>
</body>

</html>